<html>
<head></head>
<body>
<?php
$conn = new mysqli('localhost','root','','SEVENBITS','3306');
if(mysqli_connect_errno()){
echo "connection failed";
}else {
echo "connection successful";
}
$sql = "SELECT * FROM roledate,roles,wdate WHERE roledate.RoleID=roles.RoleID AND roledate.DateID = wdate.DateID";
$result = $conn->query($sql);
if($result->num_rows>0){
echo "<br>The Market is Open!<br>";
while($row = $result->fetch_assoc()){
if($row['ShiftStatus']!="Occupied"){
echo "<br>" . $row['WDate']. "<br>".$row['RoleName'];
//echo '<a href = "Schedule.php?ID=' . urlencode($row['EmpID']),'">Link to Schedule</a>';
}
}
}
else{
echo "No shifts available<br>";
echo "0 results found ";
}

$conn->close();

?>
</body>
</html>